<?php
use app\modules\admin\widgets\Alert;
use yii\helpers\Html;
use app\modules\admin\assets\AppAsset;
use yii\widgets\Breadcrumbs;
//use
AppAsset::register($this);
$this->off(Yii::$app->view->off(\yii\web\View::EVENT_END_BODY, [\yii\debug\Module::getInstance(), 'renderToolbar']));
$js = <<<JS
/* toastr 弹出框配置 */
    toastr.options = {
        "closeButton": true,
        "debug": false,
        "progressBar": true,
        "positionClass": "toast-top-right",
        "showDuration": "300",
        "hideDuration": "1000",
        "timeOut": "5000",
        "extendedTimeOut": "1000",
        "showEasing": "swing",
        "hideEasing": "linear",
        "showMethod": "fadeIn",
        "hideMethod": "fadeOut"
    };
JS;
$this->registerJs($js, \yii\web\View::POS_END);
?>
<?php $this->beginPage() ?>
<!doctype html>
<html lang="<?= \Yii::$app->language ?>">
<head class="hold-transition sidebar-mini fixed">
    <meta charset="<?= \Yii::$app->charset ?>">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <?= Html::csrfMetaTags() ?>
    <title>Document</title>
    <?= $this->head() ?>
</head>
<body class="sidebar-mini fixed">
<?php $this->beginBody() ?>
<div class="wrapper-content">
    <section class="content-header">
        <a href="" class="rfHeaderFont">
            <i class="glyphicon glyphicon-refresh"></i> 刷新
        </a>
        <?= Breadcrumbs::widget([
            'tag' => 'ol',
            'homeLink'=>[
                'label' => '<i class="fa fa-dashboard"></i>' . Yii::$app->params['admin']['home'],
                'url' => "",
            ],
            'encodeLabels' => false,
            'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
        ]) ?>
    </section>
    <section class="content">
        <?= $content; ?>
    </section>
    <?= Alert::widget(); ?>
</div>
<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>

<!--ajax模拟框加载-->
<div class="modal fade" id="ajaxModal" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <?= Html::img('@web/adminL/dist/img/loading.gif', ['class' => 'loading'])?>
                <span>加载中... </span>
            </div>
        </div>
    </div>
</div>
<!--ajax大模拟框加载-->
<div class="modal fade" id="ajaxModalLg" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-body">
                <?= Html::img('@web/adminL/dist/img/loading.gif', ['class' => 'loading'])?>
                <span>加载中... </span>
            </div>
        </div>
    </div>
</div>
<!--ajax最大模拟框加载-->
<div class="modal fade" id="ajaxModalMax" aria-hidden="true">
    <div class="modal-dialog modal-lg" style="width: 70%">
        <div class="modal-content">
            <div class="modal-body">
                <?= Html::img('@web/adminL/dist/img/loading.gif', ['class' => 'loading'])?>
                <span>加载中... </span>
            </div>
        </div>
    </div>
</div>
<!--初始化模拟框-->
<div id="rfModalBody" class="hide">
    <div class="modal-body">
        <?= Html::img('@web/adminL/dist/img/loading.gif', ['class' => 'loading'])?>
        <span>加载中... </span>
    </div>
</div>

<script>
    // 小模拟框清除
    $('#ajaxModal').on('hide.bs.modal', function () {
        $(this).removeData("bs.modal");
        $('#ajaxModal').find('.modal-content').html($('#rfModalBody').html());
    });
    // 大模拟框清除
    $('#ajaxModalLg').on('hide.bs.modal', function () {
        $(this).removeData("bs.modal");
        $('#ajaxModal').find('.modal-content').html($('#rfModalBody').html());
    });
    // 最大模拟框清除
    $('#ajaxModalMax').on('hide.bs.modal', function () {
        $(this).removeData("bs.modal");
        $('#ajaxModal').find('.modal-content').html($('#rfModalBody').html());
    });
</script>